{include file="public/header" /}
        <!--main content start-->
        <section class="main-content-wrapper">
            <section id="main-content">
                <!--tiles start-->
                <div class="row">
                    <div class="col-md-3 col-sm-6">
                        <div class="dashboard-tile detail tile-red">
                            <div class="content">
                                <h1 class="text-left" id="article_count">-</h1>
                                <p>文章数量</p>
                            </div>
                            <div class="icon"><i class="fa fa-table"></i>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3 col-sm-6">
                        <div class="dashboard-tile detail tile-blue">
                            <div class="content">
                                <h1 class="text-left" id="message_count">-</h1>
                                <!--<h1 class="text-left timer" id="message_count" data-from="0" data-to="0" data-speed="1">-</h1>-->
                                <p>客户留言</p>
                            </div>
                            <div class="icon"><i class="fa fa fa-envelope"></i>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3 col-sm-6">
                        <div class="dashboard-tile detail tile-turquoise">
                            <div class="content">
                                <h1 class="text-left" id="view_num">-</h1>
                                <!--<h1 class="text-left timer" id="view_num" data-from="0" data-to="0" data-speed="2000">-</h1>-->
                                <p>今日访问用户</p>
                            </div>
                            <div class="icon"><i class="fa fa-bar-chart-o"></i>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3 col-sm-6">
                        <div class="dashboard-tile detail tile-purple">
                            <div class="content">
                                <h1 class="text-left" id="web_count">-</h1>
                                <!--<h1 class="text-left timer" id="web_count" data-to="0" data-speed="1">-</h1>-->
                                <p>百度收录数量</p>
                            </div>
                            <div class="icon"><i class="fa fa-line-chart"></i>
                            </div>
                        </div>
                    </div>
                </div>
                <!--tiles end-->
                <!--dashboard charts and map start-->
                <div class="row">
                    <div class="col-md-6">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h3 class="panel-title">关键词排名</h3>
                                <div class="pull-right" style="width: 100%;">
                                    <!--<iframe allowtransparency="true" frameborder="0" width="385" height="96" scrolling="no" src="//tianqi.2345.com/plugin/widget/index.htm?s=1&z=1&t=0&v=0&d=3&bd=0&k=&f=&q=1&e=0&a=1&c=54511&w=385&h=96&align=center"></iframe>-->
                                    <div style="padding: 15px 0 15px 0;">
                                        <div class="table-responsive">
                                            <table class="table table-bordered table-striped">
                                                <thead>
                                                <tr>
                                                    <th>关键词</th>
                                                    <th>排名</th>
                                                    <th>重新检测</th>
                                                </tr>
                                                </thead>
                                                <tbody id="keywords_rank">
                                                <tr>
                                                    <td scope="row">-</td>
                                                    <td>-</td>
                                                    <td>-</td>
                                                </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="panel-body">
                                <div class="map" id="map" style="height: 250px;"></div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h3 class="panel-title">seo学习</h3>
                                <div class="actions pull-right">
                                    <i class="fa fa-chevron-down"></i>
                                    <i class="fa fa-times"></i>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!--dashboard charts and map end-->
                <!--ToDo start-->
                <div class="row">
                    <div class="col-md-4">
                        <div class="panel panel-solid-info">
                            <div class="panel-heading">
                                <h3 class="panel-title">泺鸿新闻</h3>
                                <div class="actions pull-right">
                                    <i class="fa fa-chevron-down"></i>
                                    <i class="fa fa-times"></i>
                                </div>
                            </div>
                            <div class="panel-body">
                                <div class="row">
                                    <div class="col-md-12">
                                        1
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="panel panel-solid-info">
                            <div class="panel-heading">
                                <h3 class="panel-title">泺鸿公告</h3>
                                <div class="actions pull-right">
                                    <i class="fa fa-chevron-down"></i>
                                    <i class="fa fa-times"></i>
                                </div>
                            </div>
                            <div class="panel-body">
                                <div class="row">
                                    <div class="col-md-12">
1
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="panel panel-solid-info">
                            <div class="panel-heading">
                                <h3 class="panel-title">软文推广</h3>
                                <div class="actions pull-right">
                                    <i class="fa fa-chevron-down"></i>
                                    <i class="fa fa-times"></i>
                                </div>
                            </div>
                            <div class="panel-body">
                                <div class="row">
                                    <div class="col-md-12">
                                        1
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!--ToDo end-->
            </section>
        </section>
        <!--main content end-->
{include file="public/footer" /}
<script>
    //获取文章和留言总数量
    $.ajax({
        type: "GET",  //提交方式
        url: "/admin/system/article_num",//路径
        data: {},
        dataType: "json",
        success: function (data) {
            if(data.status==0){
                var data = data.data;
               $('#article_count').attr('data-to',data.article).text(data.article);
               $('#message_count').attr('data-to',data.message).text(data.message);
                get_view_num();
            }else{
                alert('系统错误!');
            }
        }
    });
    //获取网站当日数量
    function get_view_num(){
        $.ajax({
            type: "GET",  //提交方式
            url: "/admin/system/web_view_num",//路径
            data: {},
            dataType: "json",
            success: function (data) {
                if(data.status==0){
                    var data = data.data;
                    $('#view_num').attr('data-to',data).text(data);
                }else{
                    alert('系统错误!');
                }
            }
        });
    }

    //获取百度收录总数量
    $.ajax({
        type: "GET",  //提交方式
        url: "/admin/seo/baidu_web_count",//路径
        data: {},
        dataType: "json",
        success: function (data) {
            if(data.status==0){
                var baidu_web_count = localStorage.getItem("baidu_web_count");
                if(baidu_web_count==data.data){
                    $('#web_count').attr('data-to',data.data).html(data.data);
                }else if(baidu_web_count>data.data){
                    $('#web_count').attr('data-to',data.data).html(data.data +'<sup class="fa fa-arrow-down" style="font-size: 20px;color: green;"></sup>');
                }else{
                    $('#web_count').attr('data-to',data.data).html(data.data +'<sup class="fa fa-arrow-up" style="font-size: 20px;color: red;"></sup>');
                }

                localStorage.setItem("baidu_web_count", data.data);
            }else{
                alert('系统错误!');
            }
        }
    });
    //获取关键词百度排名
    $.ajax({
        type: "GET",  //提交方式
        url: "/admin/seo/baidu_keyword_ranking",//路径
        data: {},
        dataType: "json",
        success: function (data) {
            if(data.status==0){
                var htmls=[];
                var data = data.data;

                for (var i=0;i<data.length;i++)
                {
                    htmls += '<tr>'
                    htmls += '<td scope="row">'+data[i].keyword+'</td>'
                    htmls += '<td>'+data[i].rank+'</td>'
                    htmls += '<td>-</td>'
                    htmls += '</tr>'
                }
                $('#keywords_rank').html(htmls);
            }else{
                alert('系统错误!');
            }
        }
    });
</script>